package com.final_;

//请编写一个程序，能够计算圆形的面积，要求圆周率为3.14，赋值的位置
//三个方式都写一下

public class FinalExercise01 {
    public static void main(String[] args) {

        Circle circle = new Circle(2);
        System.out.println("面积为 " + circle.area());

    }
}

class Circle{
    private double radius;
    private final double PI = 3.14;

    //构造器
    public Circle(double radius) {
        this.radius = radius;
    }
    public double area(){
        return PI * radius * radius;
    }
}
